﻿#include "resource.h"
#include <Windows.h>
#include <cstddef>

const unsigned char* dllResource = nullptr;

bool InitializeResources() {
    HMODULE hModule = GetModuleHandle(NULL);
    if (hModule == NULL) {
        return false;
    }

    HRSRC hResource = FindResource(hModule, MAKEINTRESOURCE(IDR_DLL_RESOURCE), RT_RCDATA);
    if (hResource == NULL) {
        return false;
    }

    HGLOBAL hGlobal = LoadResource(hModule, hResource);
    if (hGlobal == NULL) {
        return false;
    }

    dllResource = static_cast<const unsigned char*>(LockResource(hGlobal));
    if (dllResource == NULL) {
        return false;
    }
    
    return true;
}